package com.dongdong.controller;

import com.dongdong.api.SMSApi;
import com.dongdong.utils.Result;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/producer")
public class ProducerController {

    @Autowired
    private RocketMQTemplate rocketMQTemplate;

    @GetMapping("/send")
    public Result send(@RequestParam String phone){
        rocketMQTemplate.convertAndSend("SMS",phone);
        return Result.OK();
    }
}
